<?php

namespace app\admin\controller\crud;

use app\admin\controller\AdminController;
use app\admin\service\crud\TableService;
use think\response\Json;

class Table extends AdminController
{

    /**
     * 获取所有的数据列表
     * @return Json
     */
    public function getAllTableList() {
        return $this->data(TableService::getAllTableList($this->getData()));
    }

    /**
     * 获取模型数据列表
     * @return Json
     */
    public function getModelList() {
        return $this->data(TableService::getModelList());
    }

    /**
     * 获取字典类型数据列表
     * @return Json
     */
    public function getCrudDictDataList() {
        $params = $this->getData(['dict_types']);
        return $this->data(TableService::getCrudDictDataList($params['dict_types']));
    }

    /**
     * 获取字典类型列表
     * @return Json
     */
    public function getCrudTypeList() {
        return $this->data(TableService::getCrudTypeList());
    }

}